<template>
	<view class="container">
		
		<!-- <image style="height: 100vh;width: 100vh;" src="../static/images/logins.jpg"></image> -->
		<view class="number" @click="skipBtn">跳过 | {{num}}S</view>
	</view>
</template>

<script>
import { login } from '../api/login'
	export default {
		data(){
			return{
				num:3,
				token:'',
				interval:''
			}
		},
		onLoad() {
			var _this=this
			this.interval =setInterval(()=>{
				_this.num=_this.num-1
				if(_this.num==0){
					clearInterval(_this.interval)
					_this.getJump()
					return false
				}
			},1000)
			console.log(this.$store.getters.token);
			this.token=this.$store.getters.token
		
		},
		methods:{
			getJump(){
				var _this=this
				setTimeout(()=>{
					if(_this.token){
						uni.reLaunch({
							url:'/pages/index'
						})
					}else{
						uni.reLaunch({
							url:'/pages/login'
						})
					}
				
				},1000)
			},
			//跳过
			skipBtn(){
				console.log('123');
			   clearInterval(this.interval)
			   this.getJump()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		width: 100%;
		height: 100vh;
		position: relative;
		background-image: url('../static/logo.jpg');
		 background-position: center;
		 background-size: contain;
		 background-repeat: no-repeat;
		 background-color: #fff;
	}
	.number{
		position: absolute;
		top: 50px;
		right: 20px;
		padding:5px 10px ;
		width: 80px;
		text-align: center;
		border-radius: 12px;
		background-color: #eee;
	}
	
</style>